import {request} from './request'

// 获取商品的详细数据
export function getGoodsDetail(iid) {
  return request({
    url: "detail",
    params: {
      iid
    }
  })
}

// 获取商品推荐信息
export function getRecommend() {
  return request({
    url: "/recommend"
  })
}

export class Goods {
  constructor(itemInfo, columns, service) {
    this.title = itemInfo.title
    this.desc = itemInfo.desc
    this.price = itemInfo.price
    this.nowPrice = itemInfo.lowNowPrice
    this.oldPrice = itemInfo.oldPrice
    this.discount = itemInfo.discountDesc
    this.columns = columns
    this.service = service
  }
}
